{include file='index@common/header' /}
<div class="row">
    <div class="col-md-3">
        <!-- 用户信息 -->
        <div class="panel panel-default">
            <!-- <div class="panel-heading">用户信息</div> -->
            <div class="panel-body">
                <div class="media">
                  <div class="media-left">
                    <a href="{:url('user/space/index',['id'=>$user['id']])}">
                      <img class="media-object" src="{$user.avatar|thumb=80,80,3}" alt="...">
                    </a>
                  </div>
                  <div class="media-body">
                    <h4 class="media-heading">{$user.nickname}</h4>
                    <p>{$user.motto|default='欢迎浏览我的空间！'}</p>
                  </div>
                </div>
            </div>
        </div>
    </div>
    <div class="col-md-9">
        <!-- 用户评论 -->
        <div class="panel panel-default">
            <!-- <div class="panel-heading">我的评论</div> -->
            <div class="panel-body">
                <h1>我的评论</h1>
                <hr>
                <!-- 显示最新的20条评论 -->
                {php}
                    $m = \think\Loader::model('content/comment');
                    $data = $m -> with('tocontent') -> where(['comment.uid'=>$user['id']]) -> order('comment.id desc') -> paginate(5);
                    $page = $data -> render();
                {/php}
                {foreach name='data' item='vo'}
                <div class="media">
                    <div class="media-left">
                        <div style="width:60px;">
                            <img src="{:get_root()}/static/index/image/sign.png" alt="">
                        </div>
                    </div>
                    <div class="media-body">
                        <p class="alert alert-info">
                            <a href="{$vo.tocontent.url}">{$vo.tocontent.title}</a>
                        </p>
                    </div>
                    <div class="media-right">
                        <div style="width:60px;"></div>
                    </div>
                </div>
                <div class="media">
                    <div class="media-left">
                        <div style="width:60px;"></div>
                    </div>
                    <div class="media-body">
                        {switch name="vo.status" }
                            {case value="99" break="1"}
                                <div class="alert alert-warning">
                                    <p class="">审核中...</p>
                                    <p class="text-right"><em>{$vo.create_time|date='Y-m-d H:i',###}</em></p>
                                </div>
                            {/case}
                            {case value="1" break="1"}
                                <div class="alert alert-danger">
                                    <p class="">{$vo.content}</p>
                                    <p class="text-right"><em>{$vo.create_time|date='Y-m-d H:i',###}</em></p>
                                </div>
                            {/case}
                            {default /}
                                <div class="alert alert-warning">
                                    <p class="">未审核！</p>
                                    <p class="text-right"><em>{$vo.create_time|date='Y-m-d H:i',###}</em></p>
                                </div>
                        {/switch}
                    </div>
                    <div class="media-right">
                        <div style="width:60px;">
                            <img src="{$user.avatar|thumb=60,60,3}" alt="">
                        </div>
                    </div>
                </div>
                <hr>
                {/foreach}
                {$page}
            </div>
        </div>
    </div>
</div>
{include file='index@common/footer' /}